// 合并复用原则
// Composite Reuse Principle, CRP
// 
// 这里用一个司机开车的例子来解释什么是合并复用原则
// 原来实现司机又能开宝马又能开大众的代码是 在 CRP-00.hpp里的
//

#pragma once

#include <iostream>
#include <string>

#include "FileSplitter.hpp"
#include "FileSplitterFactory.hpp"

using namespace std;

void test() {
	ISplitterFactory *factory = new BinarySplitterFactory;
	ISplitter *splitter = factory->createSplitter();
	splitter->split();

	delete factory;
	delete splitter;
}

void test01(ISplitterFactory *factory = new BinarySplitterFactory) {
	// ISplitterFactory *factory = new BinarySplitterFactory;
	ISplitter *splitter = factory->createSplitter();
	splitter->split();

	delete factory;
	delete splitter;
}

int main() {
	
	test();

	test01();

	return 0;
}
